DROP TABLE IF EXISTS jms_ods.yl_tmsnew_tms_vehicle;
CREATE EXTERNAL TABLE jms_ods.yl_tmsnew_tms_vehicle(
 ID bigint comment "车辆编号",  --NUMBER(11)
 PLATE_NUMBER string comment "车牌号",  --NVARCHAR2(30)
 VEHICLE_BELONG_CODE smallint comment "车辆归属代码",  --NUMBER(4)
 VEHICLE_BELONG_NAME string comment "车辆归属",  --NVARCHAR2(30)
 CARRIER_ID bigint comment "承运商ID",  --NUMBER(11)
 CARRIER_NAME string comment "承运商全名",  --NVARCHAR2(50)
 CARRIER_TYPE smallint comment "承运商类型,1:自营 2：固定外租 3:临时外租",  --NUMBER(4)
 BELONG_NETWORK_CODE string comment "所属网点编码",  --NVARCHAR2(30)
 BELONG_NETWORK_NAME string comment "所属网点名称",  --NVARCHAR2(60)
 VEHICLE_TYPE_CODE smallint comment "车辆类型编码",  --NUMBER(4)
 VEHICLE_TYPE_NAME string comment "车辆类型名称",  --NVARCHAR2(20)
 VEHICLE_BODY_CODE smallint comment "车身类型编码",  --NUMBER(4)
 VEHICLE_BODY_NAME string comment "车身类型名称",  --NVARCHAR2(20)
 VIN string comment "车架号",  --NVARCHAR2(30)
 ENGINE_NO string comment "引擎号",  --NVARCHAR2(30)
 AUDIT_STATUS smallint comment "审核状态",  --NUMBER(4)
 AUDIT_REMARK string comment "审核备注",  --NVARCHAR2(50)
 AUDIT_ID bigint comment "审核人编号",  --NUMBER(11)
 AUDITER string comment "审核人",  --NVARCHAR2(30)
 AUDIT_DATE timestamp comment "审核时间",  --DATE
 VEHICLE_CLASS_ID bigint comment "车种类ID",  --NUMBER(11)
 VEHICLE_CLASS_NAME string comment "车种类名称",  --NVARCHAR2(10)
 INSIDE_LENGTH double comment "长（M）",  --NUMBER
 INSIDE_WIDTH double comment "宽度（M）",  --NUMBER
 INSIDE_HEIGHT double comment "高度（M）",  --NUMBER
 OUTSIDE_LENGTH double comment "外廊长度 （M）",  --NUMBER
 OUTSIDE_WIDTH double comment "外廊宽度（M）",  --NUMBER
 OUTSIDE_HEIGHT double comment "外廊高度（M）",  --NUMBER
 CURB_WEIGHT double comment "整备质量(KG)",  --NUMBER
 LOAD_WEIGHT double comment "核定质量(KG)",  --NUMBER
 VEHICLE_VOLUME double comment "核定体积（M³）",  --NUMBER
 NUCLEAR_LOAD_NUM bigint comment "核载票数",  --NUMBER(11)
 TOTAL_WEIGHT double comment "总质量/牵引总质量(KG)",  --NUMBER
 TYRE_NUMBER smallint comment "轮胎数量",  --NUMBER(4)
 AXLE_NUMBER bigint comment "车辆轴数",  --NUMBER(11)
 VEHICLE_ORIGIN string comment "车辆产地",  --NVARCHAR2(30)
 VEHICLE_BRAND string comment "车辆品牌",  --NVARCHAR2(30)
 EMISSION_STANDARDS string comment "排放标准",  --NVARCHAR2(20)
 VEHICLE_DOOR_CNT bigint comment "车门",  --NUMBER(11)
 LAUNCH_DATE timestamp comment "车辆上线日期",  --DATE
 DOWN_DATE timestamp comment "车辆下线日期",  --DATE
 ONLINE_STATUS smallint comment "在线状态",  --NUMBER(4)
 FUEL_NAME string comment "燃料类型名称",  --NVARCHAR2(10)
 FUEL_NO string comment "燃料标号",  --NVARCHAR2(20)
 SKELETON_BRAND string comment "骨架品牌",  --NVARCHAR2(20)
 TRAILER_TYPE string comment "挂车类型",  --NVARCHAR2(10)
 SADDLE_MODEL bigint comment "鞍座牵引销型号  50  80  90",  --NUMBER(11)
 SADDLE_TYPE string comment "鞍座类型",  --NVARCHAR2(10)
 GAS_TYPE string comment "气管接头",  --NVARCHAR2(10)
 BOX_TYPE string comment "箱体材质",  --NVARCHAR2(20)
 SCRAP_DATE timestamp comment "报废日期",  --DATE
 IS_OUTAGE smallint comment "是否停运 1:启用 0:停用",  --NUMBER(4)
 IS_REFITTED smallint comment "是否停运 1:未改装 0:改装",  --NUMBER(4)
 MAIN_DRIVER string comment "主驾驶员",  --NVARCHAR2(30)
 MAIN_TEL string comment "主驾驶员电话",  --NVARCHAR2(20)
 COPILOT_DRIVER string comment "副驾驶",  --NVARCHAR2(30)
 COPILOT_TEL string comment "副驾驶电话",  --NVARCHAR2(20)
 DRIVING_LICENSE_PATH string comment "行驶证图片路径 多张以逗号隔开",  --NVARCHAR2(255)
 TRANSPORTATION_LICENSE_PATH string comment "运输证图片路径 多张以逗号隔开",  --NVARCHAR2(255)
 OTHER_LICENSE_PATH string comment "其它证件图片路径 多张以逗号隔开",  --NVARCHAR2(255)
 INSURANCE_COMMERCIAL_PATH string comment "商业险图片路径 多张以,隔开",  --NVARCHAR2(255)
 INSURANCE_GOODS_PATH string comment "货物险图片路径 多张以,隔开",  --NVARCHAR2(255)
 INSURANCE_COMPULSORY_PATH string comment "交强险图片路径 多张以,隔开",  --NVARCHAR2(255)
 REGISTER_DATE timestamp comment "上牌日期",  --DATE
 DRIVING_LICENSE_TIP string comment "行驶证抬头",  --NVARCHAR2(20)
 DRIVING_LICENSE_CONTACT string comment "行驶证抬头联系电话",  --NVARCHAR2(20)
 OPERATION_CHECK_DATE timestamp comment "营运证年审到期日",  --DATE
 DRIVING_LICENSE_CHECK_DATE timestamp comment "行驶证年审到期日",  --DATE
 INSURANCE_COMMERCIAL_DATE timestamp comment "商业险到日期",  --DATE
 INSURANCE_GOODS_DATE timestamp comment "货物险到日期",  --DATE
 INSURANCE_COMPULSORY_DATE timestamp comment "交强险到日期",  --DATE
 CREATE_BY bigint comment "创建人ID",  --NUMBER(11)
 CREATE_BY_NAME string comment "创建人",  --NVARCHAR2(50)
 CREATE_TIME timestamp comment "创建时间",  --DATE
 UPDATE_BY bigint comment "更新人ID",  --NUMBER(11)
 UPDATE_BY_NAME string comment "更新人",  --NVARCHAR2(50)
 UPDATE_TIME timestamp comment "更新时间"  --DATE
 )
 COMMENT '车辆'
 PARTITIONED BY (dt STRING COMMENT '更新/创建日期 (yyyy-MM-dd)')
 STORED AS PARQUET
 LOCATION '/dw/hive/jms_ods.db/external/yl_tmsnew_tms_vehicle'
 TBLPROPERTIES (
 'discover.partitions'='false',
 'parquet.column.index.access'='true'
 );

MSCK REPAIR TABLE jms_ods.yl_tmsnew_tms_vehicle;